<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

	
	
	
function t($data,$exit=1) {
	echo '<pre style="text-align:left;">';
	print_r($data);
	echo '</pre>';
	if($exit)exit;
}


$partid=0;
$url="";
	if(isset($_GET['data']))$partid=$_GET['data'];
	if(isset($_GET['url']))$url=$_GET['url'];
	
	$url=$url.'/'.$partid.'.ts';
	$opts = array('http' =>
					    array(
					        'method'  => 'GET',
					        'header'  => 'User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36\r\n'
					    	.'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n'
					    	.'Referer:'.$url.'\r\n'
					    
					    )
					);
					
	header("Content-Type: video/mp2t");
	
	header("Accept-Ranges: bytes");
	header("Cache-Control:no-cache");
	header("Server: FlashCom/3.5.7");
	
	
	
	/*
	$result= file_get_contents($url,false,stream_context_create($opts));

	
		*/
		
	
	$ch = curl_init($url);
		curl_setopt($ch, CURLOPT_HTTPHEADER, array(
	    	'method'  => 'GET',
	        'header'  => "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36\r\n"
	    	."Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n"
	    	."Referer:".$url."\r\n"
	    ));
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
	$result = curl_exec($ch);
	curl_close($ch);
	header("Content-Length:".strlen($result));
	print_r($result);
		@ob_flush();
		flush();
	
	